#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 2e5 + 10;

int a[N], b[N], f[N], n, g[N], id[N], ans[N];

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in", "r", stdin);
#endif
	n = in; rep(i, 1, n + 1) a[i] = in, id[i] = i;
	rep(i, 1, n) b[i] = in;
	sort(id + 1, id + n + 2, [](auto x, auto y) { return a[x] < a[y]; }); sort(b + 1, b + n + 1);
	rep(i, 1, n) f[i] = max(f[i - 1], a[id[i]] - b[i]);
	per(i, n + 1, 2) g[i] = max(g[i + 1], a[id[i]] - b[i - 1]);
	rep(i, 1, n + 1) ans[id[i]] = max(f[i - 1], g[i + 1]);
	rep(i, 1, n + 1) printf("%d ", ans[i]);
	puts("");
	return 0;
}
